#ifndef SERIALPORT_H
#define SERIALPORT_H

#include <QObject>
#include <QSerialPort>

class serialport:public QObject
{
     Q_OBJECT
public:
    explicit serialport(QObject *parent = nullptr);
    ~serialport();
private:
    //串口对象指针
    QSerialPort *serialPort;
    void StringToHex(QString str, QByteArray &senddata);
    char ConvertHexChar(char ch);
    const QString CarType = "car";
    const QString FaceType = "face";
    int Count;
signals:
    void carReady_flag();
    void openCamera();
    void saveImage(QString,int);
    void sqltmp(QString);
public slots:
    void sendData(QString senddata);
private slots:
    void serialPortReadyRead();

};

#endif // SERIALPORT_H
